<template>
  <div class="home-container">
    <h1>周报分析系统</h1>
    <p>欢迎使用周报分析系统，请选择以下功能：</p>
    <div class="feature-list">
      <div class="feature-item">
        <h3>周报上传</h3>
        <p>上传您的周报文件进行分析</p>
      </div>
      <div class="feature-item">
        <h3>数据分析</h3>
        <p>查看周报数据的统计分析结果</p>
      </div>
      <div class="feature-item">
        <h3>历史记录</h3>
        <p>查看过去的周报和分析结果</p>
      </div>
    </div>
    <button @click="logout" class="logout-btn">退出登录</button>
  </div>
</template>

<script>
export default {
  name: 'HomePage',
  methods: {
    logout() {
      localStorage.removeItem('token');
      this.$router.push('/login');
    }
  }
};
</script>

<style scoped>
.home-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
}

h1 {
  color: #333;
  margin-bottom: 20px;
}

.feature-list {
  display: flex;
  justify-content: space-around;
  margin: 30px 0;
}

.feature-item {
  width: 30%;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logout-btn {
  padding: 8px 15px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 20px;
}
</style>